<?php include TMPL_PATH . 'public/header.phtml'; ?>
<link rel="stylesheet" type="text/css" href="/statics/js/calendar/jscal2.css"/>
<link rel="stylesheet" type="text/css" href="/statics/js/calendar/border-radius.css"/>
<link rel="stylesheet" type="text/css" href="/statics/js/calendar/win2k.css"/>
<script type="text/javascript" src="/statics/js/calendar/calendar.js"></script>
<script type="text/javascript" src="/statics/js/calendar/lang/zh-cn.js"></script>
<div class="subnav">
    <div class="content-menu ib-a blue line-x" style="overflow:hidden;">
        <div style="float:left;margin-right:50px;">
            <a href='javascript:;' class="on"><em>用料记录</em></a>
        </div>
        <form name="searchform" action="<?php echo U('suppliers/suppliers_stats');?>"  method="post">
        <div style="float:left;">
            <select name="type" id="type">
                <option value="0" <?php if($type=='0'): echo 'selected=""'; endif;?>>面料</option>
                <option value="1" <?php if($type=='1'): echo 'selected=""'; endif;?>>里布</option>
            </select>
            <input type="submit" value="搜索" class="button" name="time_search">
        </div>
        </form>
        <div style="float:left;margin-right:50px;">
            <a href="<?php echo U('suppliers/suppliers_stats',array('start_time'=>$start_time,'end_time'=>$end_time,'type'=>$type,'action'=>'export'));?>" class="on" ><em>导出</em></a>
        </div>

    </div>

</div>
<div class="pad_10">
    <div class="table-list">
        <?php if ($type < 2 ): ?>
            <table width="100%" cellspacing="0">
                <thead>
                <tr>
                    <th width="50%" align="left">面料编号</th>
                    <th width="50%" align="center">结余(米)</th>
                </tr>
                </thead>
                <tbody>
                <?php
                if (isset($list) && $list):
                    foreach ($list as $v):
                        ?>
                        <tr>
                            <td align="left"><?php echo $v['suppliers_name'] ?></td>
                            <td align="center"><?php echo $v['inventory']['change'] == 0 ? $v['inventory']['before'] - $v['inventory']['amount'] : $v['inventory']['before'] + $v['inventory']['amount']; ?></td>
                        </tr>
                        <?php
                    endforeach;
                endif;
                ?>
                </tbody>
            </table>

        <?php endif; ?>
        <div id="pages"><?php echo $pageShow; ?></div>
    </div>
</div>
</body>
</html>
